import numpy as np

a = [1, 1, 1]
#print(np.identity(5))###生成5*5的单位矩阵
print( np.bincount(a ) )